{include file="public/header" /}



<div class="page">
   <table border="0" cellpadding="0" cellspacing="0" class="store-joinin ds-default-table">
       <thead>
           <tr>
               <th colspan="20">企业信息：</th>
           </tr>
       </thead>
       <tbody>
            <tr>
               <th class="w150">企业名称：</th>
               <td>{$joinin_detail.enterprise_name}</td>
           </tr>
           <tr>
               <th>企业类型：</th>
               <td>{$joinin_detail.name}</td>
           </tr>
           <tr>
               <th>联系人职位：</th>
               <td>{$joinin_detail.contact_title}</td>
           </tr>
           <tr>
               <th>联系人姓名：</th>
               <td>{$joinin_detail.contact_name}</td>
           </tr>
           <tr>
               <th class="w150">联系人电话：</th>
               <td>{$joinin_detail.contact_phone}</td>
           </tr>
           <tr>
               <th class="w150">联系人座机</th>
               <td>{$joinin_detail.contact_landline}</td>
           </tr>
           <tr>
               <th>联系人地址：</th>
               <td>{$joinin_detail.contact_address}</td>
           </tr>
          
       </tbody>
   </table>
      <table border="0" cellpadding="0" cellspacing="0" class="store-joinin ds-default-table">
       <thead>
           <tr>
               <th colspan="20">文件信息：</th>
           </tr>
       </thead>
       <tbody>
            <tr>
               <th class="w150">企业营业执照：</th>
               <td><img width="400px" height="300px" src="{$http_name}/{$joinin_detail.enterprise_license}" /></td>
           </tr>
       </tbody>
   </table>
   
  <form id="form_store_verify" action="{:url('Enterprise/enterprise_verify')}" method="post">
    <input id="verify_type" name="verify_type" type="hidden" />
    <input name="member_id" type="hidden" value="{$joinin_detail.member_id}" />
    <table border="0" cellpadding="0" cellspacing="0" class="store-joinin ds-default-table">
      <thead>
        <tr>
          <th colspan="20">申请人信息</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="w150">用户名：</th>
          <td>{$joinin_detail.member_name}</td>
        </tr>
         <tr>
               <th>申请时间：</th>
               <td>{$joinin_detail.enterprise_time|date="Y-m-d H:i:s",###}</td>
           </tr>
        {if $is_verify == true}
        <tr>
            <th>审核意见：</th>
            <td colspan="2"><textarea style="width: 250px;height:150px;" id="joinin_message" name="joinin_message"></textarea><div id="validation_message" style="color:red;display:none;"></div></td>
        </tr>
        {/if}
        {if $is_verify == false}
        <tr>
            <th>审核意见：</th>
            <td colspan="2"><textarea style="width: 250px;height:150px;" id="joinin_message" name="joinin_message">{$joinin_detail.reasons}</textarea><div id="validation_message" style="color:red;display:none;"></div></td>
        </tr>
        {/if}
    </tbody>
    </table>
    
    {if $is_verify == true}
    <div style="text-align: center;"><a id="btn_fail" class="btn" href="JavaScript:void(0);"><span>{$Think.lang.ds_refuse}</span></a> <a id="btn_pass" class="btn" href="JavaScript:void(0);"><span>{$Think.lang.ds_pass}</span></a></div>
    {/if}
  </form>
</div>
<link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/css/lightbox.min.css">
<script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/js/lightbox.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('#btn_fail').on('click', function() {
            if($('#joinin_message').val() == '') {
                $('#validation_message').text('请输入审核意见');
                $('#validation_message').show();
                return false;
            } else {
                $('#validation_message').hide();
            }
            layer.confirm("确定要拒绝吗", {
                btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
                title: false,
            }, function () {
                $('#verify_type').val('fail');
                $('#form_store_verify').submit();
            });
        });
        $('#btn_pass').on('click', function() {
            var valid = true;
            $('[dstype="commis_rate"]').each(function(commis_rate) {
                rate = $(this).val();
                if(rate == '') {
                    valid = false;
                    return false;
                }

                var rate = Number($(this).val());
                if(isNaN(rate) || rate < 0 || rate >= 100) {
                    valid = false;
                    return false;
                }
            });
            if(valid) {
                $('#validation_message').hide();
                layer.confirm("确定要审核通过吗", {
                    btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
                    title: false,
                }, function () {
                    $('#verify_type').val('pass');
                    $('#form_store_verify').submit();
                });
            } else {
                $('#validation_message').text('{$Think.lang.store_class_commis_rates_error}');
                $('#validation_message').show();
            }
        });
    });
</script>